﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Data;

namespace Cstudy.BLL
{
    public class Artcles
    {
        public bool AddArtcle(MODEL.artcles artcle)
        {
            return new DAL.Artcles().AddArtcle(artcle);
        }

        public bool EditArtcle(MODEL.artcles artcle)
        {
            return new DAL.Artcles().EditArtcle(artcle);
        } 

        public DataSet SelectArtcleByID(int id,bool IsView)
        {
            if (IsView)
                new DAL.Artcles().ArtcleAddReadtime(id);
            return new DAL.Artcles().SelectArtcleByID(id);
        }

        public DataSet SearchArtcleTitle(string keyword)
        {
            return new DAL.Artcles().SearchArtcleTitle(keyword);
        }

        public DataSet SearchArtcleContent(string keyword)
        {
            return new DAL.Artcles().SearchArtcleContent(keyword);
        }

        public bool DeleteArtcleByID(int id)
        {
            return new DAL.Artcles().DeleteArtcleByID(id);
        }

        public DataSet SelectArtcleByClassID(int classid)
        {
            return new DAL.Artcles().SelectArtcleByClassID(classid);
        }

        public DataSet SelectArtcleByClassID(int classid, int currentPage, int pagesize, out int num, string returnstring)
        {
            return new DAL.Artcles().SelectArtcleByClassID(classid, currentPage, pagesize, out num, returnstring);
        }

        public DataSet SelectArtcleByClassIDWithCount(int classid,int count)
        {
            return new DAL.Artcles().SelectArtcleByClassIDWithCount(classid, count);
        }

        public DataSet SelectArtcleByTagIDWithCount(int tagid, int count)
        {
            return new DAL.Artcles().SelectArtcleByTagIDWithCount(tagid, count);
        }

        public DataSet SelectArtcle()
        {
            return new DAL.Artcles().SelectArtcle();
        }

        public DataSet SelectArtcle(int currentPage, int pagesize, out int num, string returnstring)
        {
            return new DAL.Artcles().SelectArtcle(currentPage, pagesize, out num, returnstring);
        }

        public DataSet SelectNewArtcle(int count)
        {
            return new DAL.Artcles().SelectNewArtcle(count);
        }

        public DataSet SelectHotArticle(int count)
        {
            return new DAL.Artcles().SelectHotArticle(count);
        }
    }
}
